﻿<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>会员管理</title>
<link rel="stylesheet" type="text/css" href="__PUBLIC__/skin/admin/css/base.css">
<script src="__PUBLIC__/js/jquery-1.8.3.min.js"></script>
<script language="javascript">
function viewArc(aid){
	if(aid==0) aid = getOneItem();
	window.open("archives.asp?aid="+aid+"&action=viewArchives");
}
function editArc(aid){
	if(aid==0) aid = getOneItem();
	location="archives.asp?aid="+aid+"&action=editArchives";
}
function updateArc(aid){
	var qstr=getCheckboxItem();
	if(aid==0) aid = getOneItem();
	location="archives.asp?aid="+aid+"&action=makeArchives&qstr="+qstr+"";
}
function checkArc(aid){
	var qstr=getCheckboxItem();
	if(aid==0) aid = getOneItem();
	location="archives.asp?aid="+aid+"&action=checkArchives&qstr="+qstr+"";
}
function moveArc(aid){
	var qstr=getCheckboxItem();
	if(aid==0) aid = getOneItem();
	location="archives.asp?aid="+aid+"&action=moveArchives&qstr="+qstr+"";
}
function adArc(aid){
	var qstr=getCheckboxItem();
	if(aid==0) aid = getOneItem();
	location="archives.asp?aid="+aid+"&action=commendArchives&qstr="+qstr+"";
}
function delArc(aid){
	var qstr=getCheckboxItem();
	
	if(aid==0) aid = getOneItem();

	location="/Admin.php?m=User&a=del&uid="+aid+"&qstr="+qstr;
	
}

function delArcAll()
{
	var uids = [];
	$('input.select_check_box').each(function(key){
		uids.push($(this).val());
	});
	var qstr=getCheckboxItem();
	location = "/Admin.php?m=User&a=delAll&uids="+uids.join(',') ;
	return false;
}

//获得选中文件的文件名
function getCheckboxItem()
{
	var allSel="";
	if(document.form2.id.value) return document.form2.id.value;
	for(i=0;i<document.form2.id.length;i++)
	{
		if(document.form2.id[i].checked)
		{
			if(allSel=="")
				allSel=document.form2.id[i].value;
			else
				allSel=allSel+","+document.form2.id[i].value;
		}
	}
	return allSel;
}

//获得选中其中一个的id
function getOneItem()
{
	var allSel="";
	if(document.form2.id.value) return document.form2.id.value;
	for(i=0;i<document.form2.id.length;i++)
	{
		if(document.form2.id[i].checked)
		{
				allSel = document.form2.id[i].value;
				break;
		}
	}
	return allSel;
}
function selAll()
{
	for(i=0;i<document.form2.id.length;i++)
	{
		if(!document.form2.id[i].checked)
		{
			document.form2.id[i].checked=true;
		}
	}
}
function noSelAll()
{
	for(i=0;i<document.form2.id.length;i++)
	{
		if(document.form2.id[i].checked)
		{
			document.form2.id[i].checked=false;
		}
	}
}
function selectAll(type, target)
{
	var that  = $('input.selectAll'),
		input = $('input.select_check_box');

	if (type == 0)
	{
		if (that.attr("checked") == 'checked')
		{
			input.attr("checked",true);
		} else {
			input.attr("checked",false);
		}
	} else {
		if (input.attr("checked") != 'checked') {
			that.attr("checked",false);
		}
	}

}
</script>
</head>
<body leftmargin="8" topmargin="8" background='__PUBLIC__/skin/images/allbg.gif'>

<!--  快速转换位置按钮  -->
<table width="98%" border="0" cellpadding="0" cellspacing="1" bgcolor="#D1DDAA" align="center">
<tr>
 <td height="26" background="__PUBLIC__/skin/images/newlinebg3.gif">
  <table width="98%" border="0" cellspacing="0" cellpadding="0">
  <tr>
  <td align="center">用户管理</td>
 </tr>
</table>
</td>
</tr>
</table>

<form name="form1" method="post" action="">
<table width="98%" border="0" cellpadding="0" cellspacing="1"  align="center">
	<tr><td>

		<input name="keywords" maxlength="40" size=30 placeholder="请输入您要查询的用户名..." >

		<input type="submit" name="search" value="搜索">

		</td></tr>
</table>
</form>
  
<!--  内容列表   -->
<form name="form2">

<table width="98%" border="0" cellpadding="2" cellspacing="1" bgcolor="#D1DDAA" align="center" style="margin-top:8px">
<tr bgcolor="#E7E7E7">
	<td height="24" colspan="6" background="__PUBLIC__/skin/images/tbg.gif">&nbsp;管理员列表&nbsp; <a href="{:U('User/add')}">添加管理员 </a></td>
</tr>
<tr align="center" bgcolor="#FAFAF1" height="22">
	<td width="4%"><input type="checkbox" onchange="selectAll(0, this)" class="selectAll">全选</td>
	<td width="6%">用户ID</td>
	<td width="10%">用户名</td>
    	<td width="10%">账户金币</td>
	<td width="28%">用户类型</td>
	<td width="10%">注册时间</td>
    <td width="10%">状态</td>
	<td width="10%">操作</td>
	</tr>
<foreach name="list" item="vo">
<tr align='center' bgcolor="#FFFFFF" onMouseMove="javascript:this.bgColor='#FCFDEE';" onMouseOut="javascript:this.bgColor='#FFFFFF';" height="22" >
	<td><input type="checkbox" value="{$vo['uid']}" class="select_check_box" onchange="selectAll(1, this)"></td>
	<td>{$vo['uid']}</td>
	<td align="center">{$vo['username']}</td>
    <td align="center">{$vo['price']}</td>
	<td align="left">
      <switch name="vo.usertype">
       <case value="0">个人会员</case>
    <case value="1">企业会员</case>
    <case value="2">黄金会员</case>
        <case value="3">尊贵会员</case>
    <case value="4">旗舰会员</case>
    <default />
</switch>

    
    </td>
	<td>{$vo.createtime|date="Y-m-d H:m",###}</td>
   <td>  <if condition="$vo['status'] eq 1 "> <a href="{:U('status',array('uid'=>$vo['uid'],'type'=>0))}">正常</a> <else /> <a href="{:U('status',array('uid'=>$vo['uid'],'type'=>1))}">审核中</a> </if></td>
	<td><a href="{:U('del',array('uid'=>$vo['uid']))}">删除</a> | <a href="{:U('edit',array('uid'=>$vo['uid']))}">编辑会员</a> | <a href="{:U('chongzhi',array('uid'=>$vo['uid']))}">充值金币</a></td>
	</tr></foreach>

<!-- 
<tr bgcolor="#FAFAF1">
<td height="28" colspan="6">
	&nbsp;
	<a href="javascript:selAll()" class="coolbg">全选</a>
	<a href="javascript:noSelAll()" class="coolbg">取消</a>
	<a href="javascript:delArc(0)" class="coolbg">&nbsp;删除&nbsp;</a>
	
	</td>
</tr>
 -->
 
<tr align="right" bgcolor="#EEF4EA">
	<td height="36" colspan="2" align="center"><button type="button" onclick="delArcAll();">批量删除</button></td>
	<td height="36" colspan="6" align="center">{$page}</td>
</tr>
</table>

</form>

<!--  搜索表单  -->
<!-- 
<form name='form3' action='__URL__/search/' method='get'>
<input type='hidden' name='dopost' value='' />
<table width='98%'  border='0' cellpadding='1' cellspacing='1' bgcolor='#CBD8AC' align="center" style="margin-top:8px">
  <tr bgcolor='#EEF4EA'>
    <td background='skin/images/wbg.gif' align='center'>
      <table border='0' cellpadding='0' cellspacing='0'>
        <tr>
          <td width='90' align='center'>搜索条件：</td>
          <td width='160'>
          <select name='cid' style='width:150'>
          <option value='0'>选择类型...</option>
          	<option value='1'>名称</option>
          </select>
        </td>
        <td width='70'>
          关键字：
        </td>
        <td width='160'>
          	<input type='text' name='keyword' value='' style='width:150px' />
        </td>
        <td width='110'>
    		<select name='orderby' style='width:80px'>
            <option value='id'>排序...</option>
            <option value='creat_time'>发布时间</option>
      	</select>
        </td>
        <td>
          <input name="imageField" type="image" src="__PUBLIC__/skin/admin/images/frame/search.gif" width="45" height="20" border="0" class="np" />
        </td>
       </tr>
      </table>
    </td>
  </tr>
</table>
</form>
-->
</body>
</html>